extends "../feiteliedadi-2/feiteliedadi-2.gd"

func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("每{cd}秒吸收周围3格的所有敌方单位20%的装甲为己用", "暗黑狂想曲", "darkSong", 8)
var p3 = 3
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "darkSong":
		darkSong()

func darkSong():
	var buff = hasBuff("b_h39") 
	if buff == null:
		buff = addBuff(b_h39.new())
	for i in getCellChas(cell, p3, 1):
		if i.att.def < 5:continue
		var f1 = i.att.def * 0.2
		var bf = i.hasBuff("b_h39") 
		if bf == null:
			i.addBuff(b_h39.new(-f1))
		else:
			bf.att.def += -f1
		buff.att.def += f1

class b_h39:
	extends "../../../../azurlane_ctrl/AzurBuff.gd"
	func _init(def = 0):
		attInit()
		id = "b_h39"
		att.def = def
		buffName = "暗黑狂想曲"
		dispel = 2
		if att.def < 0:
			isNegetive = true